package com.lanou.dllo.vc.greendao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.lanou.dllo.vc.greendao.UserInfo;
import com.lanou.dllo.vc.greendao.ChatMessage;

import com.lanou.dllo.vc.greendao.UserInfoDao;
import com.lanou.dllo.vc.greendao.ChatMessageDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userInfoDaoConfig;
    private final DaoConfig chatMessageDaoConfig;

    private final UserInfoDao userInfoDao;
    private final ChatMessageDao chatMessageDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userInfoDaoConfig = daoConfigMap.get(UserInfoDao.class).clone();
        userInfoDaoConfig.initIdentityScope(type);

        chatMessageDaoConfig = daoConfigMap.get(ChatMessageDao.class).clone();
        chatMessageDaoConfig.initIdentityScope(type);

        userInfoDao = new UserInfoDao(userInfoDaoConfig, this);
        chatMessageDao = new ChatMessageDao(chatMessageDaoConfig, this);

        registerDao(UserInfo.class, userInfoDao);
        registerDao(ChatMessage.class, chatMessageDao);
    }
    
    public void clear() {
        userInfoDaoConfig.getIdentityScope().clear();
        chatMessageDaoConfig.getIdentityScope().clear();
    }

    public UserInfoDao getUserInfoDao() {
        return userInfoDao;
    }

    public ChatMessageDao getChatMessageDao() {
        return chatMessageDao;
    }

}
